#include <iostream>
#include <stack>
#include <string>

using namespace std;

int Solution()
{
	string str("ahaha");
  int mid = str.length() / 2;
  stack<char> s;
  for (int i = 1; i <= mid; i++)
    s.push(str[i]);
  if (str.length() % 2 == 0)
  {
    for (int i = 1; i <= mid; i++)
    {
      char pd = s.top();
      s.pop();
      if (pd != str[mid + 1 - i])
        return 0;
    }
  }
  else
  {
    for (int i = 1; i <= mid; i++)
    {
      char pd = s.top();
      s.pop();
      if (pd != str[mid * 2 + 1 - i])
        return 0;
    }
  }
  return 1;
}